# Maintainer: justforlxz <justforlxz@gmail.com>
pkgname=dtkcommon-git
pkgver=5.5.17.r8.gfe3dd87
pkgrel=1
sourcename=dtkcommon
sourcetars=("$sourcename"_"$pkgver".tar.xz)
sourcedir="$sourcename"
pkgdesc='DTK common modules'
arch=('any')
url="https://github.com/linuxdeepin/dtkcommon"
license=('LGPL3')
depends=('dconf')
makedepends=('cmake' 'ninja')
provides=('dtkcommon')
groups=('deepin-git')
source=("${sourcetars[@]}")
sha512sums=('SKIP')

build() {
  cd "$sourcedir"
  version=$(echo $pkgver | awk -F'[+_~-]' '{print $1}')
  cmake . -GNinja \
    -DDTK_VERSION=$version \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_INSTALL_PREFIX=/usr
  ninja
}

package() {
  cd "$sourcedir"
  DESTDIR="$pkgdir" ninja install
}
